import 'package:flutter/material.dart';

class ImageCase extends StatelessWidget {
  const ImageCase({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 200,
      height: 200,
      decoration: BoxDecoration(
        color: Colors.green,
        // 圆角背景图
        borderRadius: BorderRadius.circular(200 / 2),
        // 能实现但是写法有些麻烦
        // image: const DecorationImage(
        //   image: NetworkImage(
        //     'https://img2.baidu.com/it/u=3643967785,2746514996&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=664',
        //   ),
        //   fit: BoxFit.cover,
        // ),
      ),
      child: Image.asset(
        "open_eyes.png",
        fit: BoxFit.cover, // 图片填充方式，cover 占满容器
        // width: 100,
        // height: 100,
      ),
    );
  }
}
